const url = require('url');

var urlBaidu = 'https://www.baidu.com';

var url1 = url.resolve(urlBaidu,'/about');
console.log(url1);

var url2 = url.resolve(url1,'/list');
console.log(url2);

var url3 = url.resolve(urlBaidu,'/list');
console.log(url3);